import { request } from 'umi';

export async function getGenerateConfigAll(params: object = {}) {
  return request<ApiResponse.ResultModel<GenerateConfigType.GenerateConfigResponse>>('/api/GenerateConfig/GetAll', {
    method: 'GET',
    params: params,
  });
}

export async function addGenerateConfig(data: GenerateConfigType.GenerateConfigRequest) {
 return request<ApiResponse.ResultModel<GenerateConfigType.GenerateConfigResponse>>('/api/GenerateConfig/Add', {
    method: 'POST',
    data: [data],
  });
}

export async function patchGenerateConfig(id: number, filePath: string) {
  return request<ApiResponse.ResultModel<GenerateConfigType.GenerateConfigResponse>>('/api/GenerateConfig/PatchById?id=' + id, {
    method: 'patch',
    data: [{ "id": id, "op": "replace", "path": "/FilePath", "value": filePath }],
  });
}
